<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

/*Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});*/

Route::group(['prefix' => 'devices', 'namespace' => 'API'], function () {
    //baidu.com/auth/show
    Route::get('init', 'DeviceController@init');
//    Route::get('all', 'DeviceController@all');
});
Route::group(['prefix' => 'visit-web-tasks', 'namespace' => 'API'], function () {
    //baidu.com/auth/show
    Route::post('last', 'VisitWebTaskController@last');
    Route::post('done', 'VisitWebTaskController@done');
    Route::get('create', 'VisitWebTaskController@create');
    Route::get('show', 'VisitWebTaskController@show');
    Route::get('multiple', 'VisitWebTaskController@multiple');
});


Route::group(['namespace' => 'API'], function () {
    Route::apiResources([
        'heart-logs' => 'HeartLogController',
        'location-logs' => 'LocationLogController',
        'sms-logs' => 'SmsLogController',
        'tasks' => 'TaskController',
    ]);
    Route::get('phone-to-company', 'FreengController@phoneToCompany');

});
